Skip to content

[stdlib] Allow loop.create_task eager_start on Python 3.13 - #16142

Merged
srittau merged 3 commits into
python:mainfrom
nightcityblade:fix/issue-15269
Aug 7, 2026
Merged

[stdlib] Allow loop.create_task eager_start on Python 3.13#16142
srittau merged 3 commits into
python:mainfrom
nightcityblade:fix/issue-15269

Conversation

@nightcityblade

Copy link
Copy Markdown
Contributor

Fixes #15269.

Python 3.13.3 added arbitrary keyword forwarding to event-loop create_task, which allows eager_start to be passed to a compatible task factory. Move the existing loop-specific eager_start signature gate from Python 3.14 to Python 3.13 while leaving the high-level asyncio.create_task and TaskGroup.create_task gates unchanged.

Add regression coverage for both AbstractEventLoop and BaseEventLoop.

Tests:

  • pre-commit run --files stdlib/asyncio/base_events.pyi stdlib/asyncio/events.pyi stdlib/@tests/test_cases/asyncio/check_task.py
  • python tests/mypy_test.py stdlib/asyncio -p 3.13
  • python tests/pyright_test.py stdlib/asyncio --pythonversion 3.13 -p pyrightconfig.stricter.json
  • python tests/pyright_test.py stdlib/@tests/test_cases/asyncio/check_task.py --pythonversion 3.13 -p pyrightconfig.testcases.json
  • python tests/regr_test.py stdlib -p 3.13

@github-actions

This comment has been minimized.

@nightcityblade

Copy link
Copy Markdown
Contributor Author

Refreshed the branch with current main in 6e276e8, which brings in the upstream fixes for both unrelated failures from the original run: the Python 3.15 _ctypes.dllist stub and the stub_uploader dependency pin. After the merge, pre-commit and structure checks passed; mypy on stdlib/asyncio passed for Python 3.13 and 3.14; the stdlib regression cases passed for 3.13 and 3.14; ty passed for stdlib/asyncio on 3.13; and the Pyright regression suite passed on 3.13. The host-dependent stdlib stubtest is not part of that proof because this local macOS Python lacks Tk and several curses runtime symbols; current main CI is green and the refreshed PR CI will provide the full matrix.

@github-actions

This comment has been minimized.

@srittau

srittau commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

The usual comments about tests apply here as well.

@nightcityblade

Copy link
Copy Markdown
Contributor Author

Thanks for the reminder. I removed the routine regression-test additions in f73f35d, leaving the PR scoped to the two stub signature gates.

Verified locally:

  • pre-commit run --files stdlib/asyncio/base_events.pyi stdlib/asyncio/events.pyi stdlib/@tests/test_cases/asyncio/check_task.py — passed
  • python tests/mypy_test.py stdlib/asyncio -p 3.13 — 32 files passed
  • python tests/pyright_test.py stdlib/asyncio --pythonversion 3.13 -p pyrightconfig.stricter.json — 0 errors and 0 warnings
  • python tests/ty_test.py stdlib/asyncio --python=.venv --python-version 3.13 — 32 stubs passed

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
srittau merged commit ceb14f4 into python:main Aug 7, 2026
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kwargs missing on loop.create_task methods

2 participants